7c513f5289359a0f1fc32103f440cb4fde24bb2a,janino/src/org/codehaus/janino/UnitCompiler.java,UnitCompiler,invokeConstructor,#Locatable#Scope#Rvalue#IClass#Rvalue[]#,7392
Before Change
assert fd.variableDeclarators.length == 1;
String constantName = fd.variableDeclarators[0].name;
this.pushConstant(locatable, constantName);
int ordinal = 0;
for (EnumConstant ec : ed.getConstants()) {
After Change
if (scope instanceof FieldDeclaration) {
FieldDeclaration fd = (FieldDeclaration) scope;
if (!(fd.getEnclosingScope() instanceof EnumDeclaration)) break ENUM_CONSTANT;
EnumDeclaration ed = (EnumDeclaration) fd.getEnclosingScope();
if (fd.variableDeclarators.length != 1) break ENUM_CONSTANT;
String fieldName = fd.variableDeclarators[0].name;
int ordinal = 0;
for (EnumConstant ec : ed.getConstants()) {
if (fieldName.equals(ec.name)) {
// Now we know that the field IS an enum constant.
this.pushConstant(locatable, fieldName);
this.pushConstant(locatable, ordinal);
break ENUM_CONSTANT;
}